import { configDefaults, defineProject } from 'vitest/config'
import { fileURLToPath, URL } from 'node:url'

export default defineProject({
  test: {
    ...configDefaults,
    include: ['../packages/*/test/**/*.{test,spec}.?(c|m)[jt]s?(x)'],
    alias: [
      {
        find: /@ginkgo\/(\w+)\//,
        replacement: fileURLToPath(new URL(`../packages/$1/src/`, import.meta.url))
      },
      {
        find: /@ginkgo\/(\w+)$/,
        replacement: fileURLToPath(new URL(`../packages/$1/src`, import.meta.url))
      }
    ]
  }
})
